import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter) // VueRouter插件初始化

import Def from '../work/404.vue'
import Home from '../work/Home.vue'
import Byby from '../work/Byby.vue'




const router = new VueRouter({
  // routes 路由规则们
  // route  一条路由规则 { path: 路径, component: 组件 }
  routes: [
    {
      path: '/',
      name: 'Home',
      //重定向
      redirect: '/byby',
      component: Home
    },
    {
      path: '/byby',
      name: 'Byby',

      component: Byby
    },
    {
      // 默认写到最后一个
      path: '*',
      name: 'Def',
      component: Def
    },

  ]
})
export default router